package com.beimi.game.action;

public abstract class DelayAction extends IAction {
	private long nextFireTime;

	public DelayAction(long delay){
		nextFireTime = System.currentTimeMillis() + delay;
	}
	
	public long getNextFireTime() {
		return nextFireTime;
	}

	public void setNextFireTime(long nextFireTime) {
		this.nextFireTime = nextFireTime;
	}
	
	@Override
	public void execute(Object object) {
		if (System.currentTimeMillis() > nextFireTime) {
			executeAtTime();
		}
	}

	public abstract void executeAtTime();
}
